//首先导入path模块
const path = require('path')
//使用path.join实现路径拼接首先导入fs模块
const fs = require('fs')
//注意：../会抵消前面的路径
/* const pathStr = path.join('/a','/b/c','../','./d','e')
console.log(pathStr) */   // \a\b\d\e
fs.readFile(path.join(__dirname,'/files/1.txt'),'utf8', function(err, dataStr){
  if(err){
    return console.log(err.message)
  }
  console.log(dataStr)
})